package com.davies.learn.feature;

import java.time.LocalDateTime;
import java.util.concurrent.SubmissionPublisher;
import java.util.function.Consumer;

/**
 * @author davies
 * @date 2023/7/26 02:28
 */
public class Car2 {

    private final SubmissionPublisher<String> publisher;

    public Car2(SubmissionPublisher<String> publisher) {
        this.publisher = publisher;
    }

    public void start(){

        String timeStr = LocalDateTime.now().toString();
        this.publisher.submit("王总出发了," + timeStr);

        System.out.println("王总走了");

    }
}
